package tool

import (
	"fmt"
	"github.com/gomodule/redigo/redis"
)

var RsPool redis.Pool

func init() {
	//port := 6379
	//if viper.IsSet("redis.port") {
	//	port = viper.GetInt("redis.port")
	//}
	//host := "127.0.0.1"
	//if viper.IsSet("redis.host") {
	//	host = viper.GetString("redis.host")
	//}

	//address := fmt.Sprintf("%s:%v", host, port)
	//fmt.Println(address)

	RsPool = redis.Pool{Dial: func() (redis.Conn, error) {

		dial, err := redis.Dial("tcp", "8.142.102.189:6379")
		if err != nil {
			return nil, err
		}
		return dial, nil
	}}
	fmt.Println("redis connect")
}
